package php4dvdPages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 * @author Anna Alexeyenko
 *         Date: 1/26/13
 */
public abstract class AnyPage extends Page {

    @FindBy(tagName = "footer")
    private WebElement footer;

    @FindBy(xpath = "//*[@class=\"languages\"]//a[@href=\"./?lang=en_US\"]")
    private WebElement engLang;

    @FindBy(xpath = "//*[@class=\"languages\"]//a[@href=\"./?lang=nl_NL\"]")
    private WebElement nlLang;

    public void switchToEnglish() {
        if (!engLang.isSelected()) {
            engLang.click();
        }
    }

    public void switchToNederlands() {
        if (!nlLang.isSelected()) {
            nlLang.click();
        }
    }

}
